package model.pojo;
// Generated Sep 3, 2012 11:51:00 PM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PhieuThu generated by hbm2java
 */
@Entity
@Table(name="phieu_thu"
    ,schema="public"
)
public class PhieuThu  implements java.io.Serializable {


     private int maPhieuThu;
     private NhanVien nhanVien;
     private Date ngayLap;
     private Double tongTien;
     private Set<ChiTietPt> chiTietPts = new HashSet<ChiTietPt>(0);

    public PhieuThu() {
    }

	
    public PhieuThu(int maPhieuThu) {
        this.maPhieuThu = maPhieuThu;
    }
    public PhieuThu(int maPhieuThu, NhanVien nhanVien, Date ngayLap, Double tongTien, Set<ChiTietPt> chiTietPts) {
       this.maPhieuThu = maPhieuThu;
       this.nhanVien = nhanVien;
       this.ngayLap = ngayLap;
       this.tongTien = tongTien;
       this.chiTietPts = chiTietPts;
    }
   
     @Id 
    
    @Column(name="ma_phieu_thu", unique=true, nullable=false)
    public int getMaPhieuThu() {
        return this.maPhieuThu;
    }
    
    public void setMaPhieuThu(int maPhieuThu) {
        this.maPhieuThu = maPhieuThu;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ma_nhan_vien")
    public NhanVien getNhanVien() {
        return this.nhanVien;
    }
    
    public void setNhanVien(NhanVien nhanVien) {
        this.nhanVien = nhanVien;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="ngay_lap", length=29)
    public Date getNgayLap() {
        return this.ngayLap;
    }
    
    public void setNgayLap(Date ngayLap) {
        this.ngayLap = ngayLap;
    }
    
    @Column(name="tong_tien", precision=17, scale=17)
    public Double getTongTien() {
        return this.tongTien;
    }
    
    public void setTongTien(Double tongTien) {
        this.tongTien = tongTien;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="phieuThu")
    public Set<ChiTietPt> getChiTietPts() {
        return this.chiTietPts;
    }
    
    public void setChiTietPts(Set<ChiTietPt> chiTietPts) {
        this.chiTietPts = chiTietPts;
    }




}


